import tkinter as tk

top = tk.Tk()
top.title('Hello Tk')
ipx = 2
top.resizable(False, False)
frames = []
for i in range(10):
    f = tk.Frame(top)
    f.pack(side = tk.TOP, fill = tk.X)
    frames.append(f)

tri = [[1], [1, 1]]
for i in range(2, 10):
    a = [1]
    n = len(tri[i - 1])
    for j in range(n - 1):
        b = tri[i - 1][j] + tri[i - 1][j + 1]
        a.append(b)
    a.append(1)
    tri.append(a)


for i in range(len(tri)):
    for item in tri[i]:
        info = str(item)
        label = tk.Label(frames[i], width = 3, text = info, relief = tk.SUNKEN)
        label.pack(side = tk.LEFT, ipadx = ipx, padx = 1)

top.mainloop()
